package com.oig.sys.auth.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;
import java.io.Serializable;


/**
 * @author wuxl
 * 资源数据列表
 */
@Getter
@Setter
@ToString
@Entity
@Table(name = "tb_resource_column")
public class TbResourceColumn implements Serializable {

	/**
	 */
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name = "id", nullable = false)
	private Integer id;

	/**
	 */
	@Column(name = "user_column_id")
	private Integer userColumnId;

	/**
	 */
	@Column(name = "code", length = 32)
	private String code;

	/**
	 */
	@Column(name = "resource_id")
	private Integer resourceId;

	/**
	 */
	@Column(name = "column_name", length = 128)
	private String columnName;


	//列别名 通用查询返回的是别名
	@Column(name = "column_field")
	private String columnField;

	/**
	 */
	@Column(name = "column_property", length = 128)
	private String columnProperty;

	/**
	 */
	@Column(name = "column_table_name", length = 128)
	private String columnTableName;

	/**
	 */
	@Column(name = "column_table", length = 128)
	private String columnTable;

	/**
	 */
	@Column(name = "column_col", length = 128)
	private String columnCol;

	/**
	 */
	@Column(name = "list_sort")
	private Integer listSort;

	/**
	 * 是否主键列
	 */
	@Column(name = "is_primary_key")
	private String isPrimaryKey;

	/**
	 */
	@Column(name = "is_order_flag")
	private String isOrderFlag;

	/**
	 */
	@Column(name = "is_change_flag")
	private String isChangeFlag;

	/**
	 */
	@Column(name = "is_show_flag")
	private String isShowFlag;

	/**
	 */
	@Column(name = "show_align")
	private String showAlign;

	/**
	 */
	@Column(name = "show_width", length = 128)
	private String showWidth;

	/**
	 */
	@Column(name = "show_class_json", length = 512)
	private String showClassJson;

	/**
	 */
	@Column(name = "create_user_id")
	private Integer createUserId;

	/**
	 */
	@Column(name = "create_user_name", length = 32)
	private String createUserName;

	/**
	 */
	@CreatedDate
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time")
	private java.util.Date createTime;

	/**
	 */
	@Column(name = "last_update_id")
	private Integer lastUpdateId;

	/**
	 */
	@Column(name = "last_update_name", length = 32)
	private String lastUpdateName;

	/**
	 */
	@LastModifiedDate
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "last_update_time")
	private java.util.Date lastUpdateTime;

	/**
	 */
	@Version
	@Column(name = "version")
	private Integer version;



	//column_value_type //列值类型 0-数值（浮点数+整数）1-整数  2-字符串 3-日期 4-日期时间 5-时间 6-枚举 当枚举时enum_value_json有值
	@Column(name = "column_value_type")
	private String columnValueType ;

	/**
	 */
	@Column(name = "enum_value_json", length = 512)
	private String enumValueJson;


	//query_flag  //列是否支持查询
	@Column(name = "query_flag")
	private String queryFlag ;

	//query_show_flag  //列支持查询时，默认是否显示 0-否 1-是（收起）
	@Column(name = "query_show_flag")
	private String queryShowFlag ;

	//query_type    //列查询组件类型
	@Column(name = "query_type")
	private String queryType ;

	//query_type_api    //查询列依赖接口
	@Column(name = "query_type_api")
	private String queryTypeApi ;

	//query_sort        //列查询组件显示顺序号
	@Column(name = "query_sort")
	private Integer querySort ;
}
